package com.fbinggun.fbinggunutil.statistics.datatype;

import com.alibaba.fastjson.JSONObject;
import com.fbinggun.fbinggunutil.statistics.StatisticsInfo;

public class LongInfo extends StatisticsInfo<Long> {

    public LongInfo(String id, Long aLong) {
        super(id, aLong);
    }

    public LongInfo(String id, JSONObject jsonObject) {
        super(id, jsonObject);
    }

    @Override
    public StatisticsInfo copy(String id, JSONObject jsonObject) {
        return new LongInfo(id,jsonObject);
    }

    @Override
    public StatisticsInfo copy(String id, Long aLong) {
        return new LongInfo(id,aLong);
    }

    @Override
    public void addValue(Long l) {
        setValue(getValue()+l);
    }

    @Override
    public String getPlaceholder() {
        return String.valueOf(getValue());
    }

    @Override
    protected void addSValue(String v) {
        t=Long.parseLong(v)+t;
    }
    protected void setSValue(String v) {
        t=Long.parseLong(v);
    }

}
